#英雄类
class Hero():
    #构造函数，放置初始化变量
    def __init__(self, hero_hp, hero_power, hero_name):
        # 英雄的两个属性hero_hp，hero_power
        self.hero_hp = hero_hp
        self.hero_power = hero_power
        # 英雄的名字
        self.hero_name = hero_name

    #fight 方法
    def fight(self, enemy_hp, enemy_power):
        """
        :param enemy_hp: fight方法的参数enemy_hp
        :param enemy_power:fight方法的参数enemy_power
        :return:
        """
        #英雄最终的⾎量 = 英雄hp属性-敌⼈的攻击⼒enemy_power
        hero_final_hp = self.hero_hp - enemy_power
        #敌⼈最终的⾎量 = 敌⼈的⾎量enemy_hp-英雄的power属性
        enemy_final_hp = enemy_hp - self.hero_power

        if hero_final_hp > enemy_final_hp:
            print(f"{self.hero_name}获胜")
        elif hero_final_hp < enemy_final_hp:
            print("敌人获胜")
        else:
            print("平局")



#Timo类继承Hero
class Timo(Hero):
    pass
#Jinx类继承Hero
class Jinx(Hero):
    pass



# timo = Timo(1000, 210, "timo")
# jinx = Jinx(1100, 190, "jinx")
# timo.fight(jinx.hero_hp, jinx.hero_power)


